class {
    onCreate() {
        this.state = {
            toggle: true
        }
    }
    toggle() {
        this.state.toggle = !this.state.toggle;
    }
}

<div class=state.toggle ? "a" : null id=state.toggle ? "b" : null style=state.toggle ? "color:green" : null/>
